package com.ch.home.testMapper;

import com.ch.home.bean.Feedback;
import com.ch.home.mapper.userMessageMapper.FeedbackMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;

/**
 * Created by CHEN on 2019/8/24.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class testFeedbackMapper {


    @Autowired
    FeedbackMapper feedbackMapper;

    private static Feedback feedback;

    @Test
    public void testAddFeedback() {
        feedback = new Feedback(null, 2, "我觉得这个后台设计的有点问题，有很大的进步空间", new Date( ));

        System.out.println(feedbackMapper.addFeedback(feedback));


    }


    @Test
    public void testGetFeedback() {

        System.out.println("-------------------------------------");
        System.out.println(feedbackMapper.getFeedback(null, null, null));
        System.out.println("-------------------------------------");
        System.out.println(feedbackMapper.getFeedback(2, null, null));
        System.out.println("-------------------------------------");
        System.out.println(feedbackMapper.getFeedback(null, null, new Date( )));
        System.out.println("-------------------------------------");

    }
}
